<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			window.onload=function(){
				let myDisplay=document.getElementById("display");
				myDisplay.innerHTML = arraySum([1,2,3])+"<br>";
				myDisplay.innerHTML += objectSum({z: 4, y: 5, x: 6})
				function arraySum([x, y, z]) {
					return x+y+z
				}
				function objectSum({x, y, z}){
					return x+y+z
				}
			}
		</script>
	</head>
	<body>
		<div id="display"></div>
	</body>
</html>